﻿using UnityEngine;
using System;
using System.Collections;
using Hont.C2UTool;

public class C2UStaticInfoMeshColliderSyncer : MonoBehaviour, IC2UStaticInfoReceiver
{
    public string physicsMaterialPath;


    public void OnStaticInfoReplaced(GameObject root)
    {
        var collider = gameObject.AddComponent<MeshCollider>();

        if (collider != null && !string.IsNullOrEmpty(physicsMaterialPath))
            collider.sharedMaterial = Resources.Load<PhysicMaterial>(physicsMaterialPath);

        DestroyImmediate(this);
    }

    public void OnStaticInfoReplacedLate(GameObject root)
    {
    }
}
